CountCellsFloat Function

private function CountCellsFloat(grid) result(count)

count number of cells different from nodata

Arguments

Type IntentOptional Attributes Name
type(grid_real), intent(in) :: grid

Return Value integer(kind=short)


Variables

Type Visibility Attributes Name Initial
integer(kind=short), public :: i
integer(kind=short), public :: j

Source Code

FUNCTION CountCellsFloat &
!
(grid) &
!
RESULT (count)

IMPLICIT NONE

!Arguments with intent(in):
TYPE (grid_real), INTENT(IN) :: grid

!Local declaration
INTEGER (KIND = short) :: count
INTEGER (KIND = short) :: i, j

!---------------------end of declarations--------------------------------------

count = 0
DO i = 1, grid % idim
  DO j = 1, grid % jdim
    IF (grid % mat(i,j) /= grid % nodata) THEN
      count = count + 1
    END IF
  END DO
END DO

RETURN
END FUNCTION CountCellsFloat